\(\int (c+d x) \cos (a+b x) \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 27 \[ \int (c+d x) \cos (a+b x) \, dx=\frac {d \cos (a+b x)}{b^2}+\frac {(c+d x) \sin (a+b x)}{b} \]

[Out]

d*cos(b*x+a)/b^2+(d*x+c)*sin(b*x+a)/b

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3377, 2718} \[ \int (c+d x) \cos (a+b x) \, dx=\frac {d \cos (a+b x)}{b^2}+\frac {(c+d x) \sin (a+b x)}{b} \]

[In]

Int[(c + d*x)*Cos[a + b*x],x]

[Out]

(d*Cos[a + b*x])/b^2 + ((c + d*x)*Sin[a + b*x])/b

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x) \sin (a+b x)}{b}-\frac {d \int \sin (a+b x) \, dx}{b} \\ & = \frac {d \cos (a+b x)}{b^2}+\frac {(c+d x) \sin (a+b x)}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96 \[ \int (c+d x) \cos (a+b x) \, dx=\frac {d \cos (a+b x)+b (c+d x) \sin (a+b x)}{b^2} \]

[In]

Integrate[(c + d*x)*Cos[a + b*x],x]

[Out]

(d*Cos[a + b*x] + b*(c + d*x)*Sin[a + b*x])/b^2

Maple [A] (verified)

Time = 0.68 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.04

method result size
risch \(\frac {d \cos \left (b x +a \right )}{b^{2}}+\frac {\left (d x +c \right ) \sin \left (b x +a \right )}{b}\) \(28\)
parallelrisch \(\frac {\left (d x +c \right ) b \sin \left (b x +a \right )+d \left (\cos \left (b x +a \right )-1\right )}{b^{2}}\) \(29\)
parts \(\frac {\sin \left (b x +a \right ) d x}{b}+\frac {\sin \left (b x +a \right ) c}{b}+\frac {d \cos \left (b x +a \right )}{b^{2}}\) \(36\)
derivativedivides \(\frac {-\frac {d a \sin \left (b x +a \right )}{b}+c \sin \left (b x +a \right )+\frac {d \left (\cos \left (b x +a \right )+\left (b x +a \right ) \sin \left (b x +a \right )\right )}{b}}{b}\) \(51\)
default \(\frac {-\frac {d a \sin \left (b x +a \right )}{b}+c \sin \left (b x +a \right )+\frac {d \left (\cos \left (b x +a \right )+\left (b x +a \right ) \sin \left (b x +a \right )\right )}{b}}{b}\) \(51\)
norman \(\frac {\frac {2 d}{b^{2}}+\frac {2 c \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+\frac {2 d x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}}{1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )}\) \(55\)
meijerg \(\frac {2 d \cos \left (a \right ) \sqrt {\pi }\, \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cos \left (b x \right )}{2 \sqrt {\pi }}+\frac {x b \sin \left (b x \right )}{2 \sqrt {\pi }}\right )}{b^{2}}-\frac {2 d \sin \left (a \right ) \sqrt {\pi }\, \left (-\frac {x b \cos \left (b x \right )}{2 \sqrt {\pi }}+\frac {\sin \left (b x \right )}{2 \sqrt {\pi }}\right )}{b^{2}}+\frac {c \cos \left (a \right ) \sin \left (b x \right )}{b}-\frac {c \sin \left (a \right ) \sqrt {\pi }\, \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (b x \right )}{\sqrt {\pi }}\right )}{b}\) \(106\)

[In]

int((d*x+c)*cos(b*x+a),x,method=_RETURNVERBOSE)

[Out]

d*cos(b*x+a)/b^2+(d*x+c)*sin(b*x+a)/b

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.04 \[ \int (c+d x) \cos (a+b x) \, dx=\frac {d \cos \left (b x + a\right ) + {\left (b d x + b c\right )} \sin \left (b x + a\right )}{b^{2}} \]

[In]

integrate((d*x+c)*cos(b*x+a),x, algorithm="fricas")

[Out]

(d*cos(b*x + a) + (b*d*x + b*c)*sin(b*x + a))/b^2

Sympy [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.70 \[ \int (c+d x) \cos (a+b x) \, dx=\begin {cases} \frac {c \sin {\left (a + b x \right )}}{b} + \frac {d x \sin {\left (a + b x \right )}}{b} + \frac {d \cos {\left (a + b x \right )}}{b^{2}} & \text {for}\: b \neq 0 \\\left (c x + \frac {d x^{2}}{2}\right ) \cos {\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((d*x+c)*cos(b*x+a),x)

[Out]

Piecewise((c*sin(a + b*x)/b + d*x*sin(a + b*x)/b + d*cos(a + b*x)/b**2, Ne(b, 0)), ((c*x + d*x**2/2)*cos(a), T
rue))

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.85 \[ \int (c+d x) \cos (a+b x) \, dx=\frac {c \sin \left (b x + a\right ) - \frac {a d \sin \left (b x + a\right )}{b} + \frac {{\left ({\left (b x + a\right )} \sin \left (b x + a\right ) + \cos \left (b x + a\right )\right )} d}{b}}{b} \]

[In]

integrate((d*x+c)*cos(b*x+a),x, algorithm="maxima")

[Out]

(c*sin(b*x + a) - a*d*sin(b*x + a)/b + ((b*x + a)*sin(b*x + a) + cos(b*x + a))*d/b)/b

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.11 \[ \int (c+d x) \cos (a+b x) \, dx=\frac {d \cos \left (b x + a\right )}{b^{2}} + \frac {{\left (b d x + b c\right )} \sin \left (b x + a\right )}{b^{2}} \]

[In]

integrate((d*x+c)*cos(b*x+a),x, algorithm="giac")

[Out]

d*cos(b*x + a)/b^2 + (b*d*x + b*c)*sin(b*x + a)/b^2

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.26 \[ \int (c+d x) \cos (a+b x) \, dx=\frac {c\,\sin \left (a+b\,x\right )+d\,x\,\sin \left (a+b\,x\right )}{b}+\frac {d\,\cos \left (a+b\,x\right )}{b^2} \]

[In]

int(cos(a + b*x)*(c + d*x),x)

[Out]

(c*sin(a + b*x) + d*x*sin(a + b*x))/b + (d*cos(a + b*x))/b^2